﻿<div class="layui-form-item">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input type="text" id="EquipmentCode" placeholder="设备编号" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input type="text" id="EquipmentCode" placeholder="设备类型" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-inline">
        <a class="layui-btn" id="btnSearch">搜索</a>
    </div>
</div>
<table id="table" class="layui-table" lay-filter="table"></table>
<script>
    layui.use(['table', 'layer'], function () {
        var $ = layui.jquery;
        var table = layui.table;
        var layer = layui.layer;
        layui.tableReload = function () {
            table.reload("table", {
                where: {},//getWhere(),
                page: { curr: 1 }
            });
        }
        // 渲染表格
        table.render({
            id: "table",
            elem: '#table',
            method: "post",
            url: 'Index',
            cellMinWidth: 80,
            cols: [
                [
                    { type: 'checkbox' },
                    { field: 'EquipmentCode', title: '设备编号' },
                    { field: 'TypeName', title: '设备类型' },
                    { field: 'Remarks', title: '备注' },
                    { field: 'CreateDate', title: '创建日期' },
                ]
            ],
            done: function (res, curr, count) { //res 即为原始返回的数据
                //console.log(res.data);
            },
            page: { limit: 20 }
        });
    });
</script>
